﻿<Window x:Class="iControl.Windows.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:ic="clr-namespace:iControl.Controls"
    xmlns:properties="clr-namespace:iControl.Properties"
    Title="iControl" Width="350" Height="150" Loaded="MainWindow_Loaded" Closing="MainWindow_Closing" 
    WindowStyle="None" AllowsTransparency="True"  ShowInTaskbar="False" ShowActivated="False" Background="Transparent" 
    Topmost="True" WindowStartupLocation="Manual" FontFamily="Calibri" FontSize="12" FontWeight="Bold" 
    xmlns:iControl_Properties="clr-namespace:iControl.Properties" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Icon="..\Images\iControlIcon.ico" >
	<Window.Resources>
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="3" SnapsToDevicePixels="true"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackgroundFill" EndPoint="0.5,1" StartPoint="0.5,0">
			<GradientStop Color="White" Offset="0"/>
			<GradientStop Color="#FFE3E5F0" Offset="0.5"/>
			<GradientStop Color="#FFC6C5D7" Offset="1.0"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonBorder" Color="#FF003C74"/>
		<Style x:Key="HideButtonStyle" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackgroundFill}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonBorder}"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<ControlTemplate.Resources>
							<Storyboard x:Key="FadeInAnimation">
								<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
									<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#FF4176AD"/>
								</ColorAnimationUsingKeyFrames>
								<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
									<SplineColorKeyFrame KeyTime="00:00:00.2000000" Value="#FF000000"/>
								</ColorAnimationUsingKeyFrames>
							</Storyboard>
							<Storyboard x:Key="FadeOutAnimation">
								<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)">
									<SplineColorKeyFrame KeyTime="00:00:00.5000000" Value="#664176AD"/>
								</ColorAnimationUsingKeyFrames>
								<ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
									<SplineColorKeyFrame KeyTime="00:00:00.5000000" Value="#66000000"/>
								</ColorAnimationUsingKeyFrames>
							</Storyboard>
						</ControlTemplate.Resources>
						<Border x:Name="border" BorderBrush="#664176AD" BorderThickness="0.5,0.5,0.5,0.5" CornerRadius="3,3,3,3">
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="contentPresenter" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" OpacityMask="#66000000"/>
						</Border>
						<ControlTemplate.Triggers>
							<EventTrigger RoutedEvent="Mouse.MouseEnter">
								<BeginStoryboard x:Name="FadeInAnimation_BeginStoryboard" Storyboard="{StaticResource FadeInAnimation}"/>
							</EventTrigger>
							<EventTrigger RoutedEvent="Mouse.MouseLeave">
								<BeginStoryboard x:Name="FadeOutAnimation_BeginStoryboard" Storyboard="{StaticResource FadeOutAnimation}"/>
							</EventTrigger>
							<Trigger Property="IsKeyboardFocused" Value="true"/>
							<Trigger Property="ToggleButton.IsChecked" Value="true"/>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</Window.Resources>
	<Grid MouseEnter="MainWindow_MouseEnter" MouseLeave="MainWindow_MouseLeave">
		<Grid.Background>
			<ImageBrush ImageSource="../Images/Skin/Background.png" />
		</Grid.Background>
		<Grid x:Name="pnlTrackInfo" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="146" />
				<ColumnDefinition Width="*" />
			</Grid.ColumnDefinitions>
			<Image x:Name="imgAlbumArtwork" Stretch="UniformToFill" Width="124" Height="124" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="12,15,0,0" />            
			<Image Source="../Images/Skin/AlbumArtworkBG.png" HorizontalAlignment="Left" Margin="11,11,0,0" VerticalAlignment="Top" Width="130" Height="129" />
			<StackPanel HorizontalAlignment="Stretch" Grid.Column="1" Margin="0,0,5,0" VerticalAlignment="Center" ScrollViewer.VerticalScrollBarVisibility="Disabled">
				<Label x:Name="lblTrackTitle" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Content="{}{Track Name}"/>
				<Label x:Name="lblTrackAlbum" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Content="{}{Album Name}"/>
				<Label x:Name="lblTrackArtist" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Content="{}{Artist Name}"/>
				<ic:Rating x:Name="trackRating" Height="20" Width="125" HorizontalAlignment="Left" Margin="3,2,0,0" VerticalAlignment="Center" RatingChanged="trackRating_RatingChanged" />
			</StackPanel>
		</Grid>        
		<Grid x:Name="pnlPlaybackInfo" Visibility="Collapsed" d:IsLocked="True" Grid.ColumnSpan="2">
			<Label x:Name="lblPlaybackInfo" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="40" Content="Playback Stopped."/>
		</Grid>
		<Image Visibility="Visible" Grid.ColumnSpan="2" VerticalAlignment="Top" Height="74" Source="../Images/Skin/GlassOverlay.png" />
		<Button x:Name="btnHideTrackInfo" FontFamily="Wingdings 3" FontSize="8" FontWeight="Normal" HorizontalAlignment="Right" Width="14" Click="btnHideTrackInfo_Click" Margin="0,0,8,8" VerticalAlignment="Bottom" Height="14" Content="q" Grid.Column="1" Cursor="Hand" Style="{DynamicResource HideButtonStyle}" Foreground="#FF606060" Padding="0,1,0,0" ToolTip="{x:Static properties:Resources.HideButtonTooTip}"/>
	</Grid>
</Window>
